function calculateFormitem(calculationFormula,itemValue){
    /***************计算控件判断控件是否是计算公式中调用的控件*****************/
    var flag = false;
    var calculationSymbol = ['+','-','*','/','(',')','',' '];
    for(var i=0;i<calculationSymbol.length-2;i++){
        var aa = itemValue+calculationSymbol[i];
        var bb = calculationFormula.split(aa)[0];
        if(bb != undefined){
            bb = bb.substr(bb.length-1,1)
            if(calculationFormula.indexOf(aa) > -1&& calculationSymbol.indexOf(bb) > -1){
                flag = true;
            }
        }

    }
    for(var i=0;i<calculationSymbol.length-2;i++){
        var aa = calculationSymbol[i]+itemValue;
        if(calculationFormula.split(aa)[1] != undefined){
            var bb = calculationFormula.split(aa)[1].substr(0,1);
            if(calculationFormula.indexOf(aa) > -1&& calculationSymbol.indexOf(bb) > -1){
                flag = true;
            }
        }
    }
    return flag;
}

function compareFunc(){
    if($('.compareFormItem').length > 0){
        var compareform_item = $('.compareFormItem').attr('compareformitem');
        $.ajax({
            url:'/flowTriggerProject/budget',
            type:'get',
            data:{

            },
            async:false,
            dataType:'json',
            success:function(res){
                res = JSON.parse(res);
                if(res.code == 1){
                    var value = res.value.value[3];
                }else{
                    var value = 0;
                }
                if(parseFloat($('#'+compareform_item).val()) >= value){
                    $('.compareFormItem').val('超出预算');
                }else if(parseFloat($('#'+compareform_item).val()) < value){
                    $('.compareFormItem').val('符合预算');
                }
            }
        })
    }
}

function markFunc(){
    for(var i=0;i<$('.mark').length;i++){
        var index = $('.mark').eq(i).find('.clibg').index();
        $('.mark').eq(i).find('.form_item').val(index);
    }
}